package com.neusoft.yuejian_6.model;

import com.neusoft.yuejian_6.javabean.Classes;
import com.neusoft.yuejian_6.service.ClassService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.neusoft.yuejian_6.base.Constant.BASE_URL;

/**
 * Created by Q on 2017/10/19.
 */

public class ClassModel {
    private Retrofit retrofit;
    public ClassModel(){
        retrofit=new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call<List<Classes>> getClasses(int club_id){
        ClassService classService=retrofit.create(ClassService.class);
        return  classService.getAllClasses(club_id);

    }
    public Call<Classes> getClassById(int class_id){
        ClassService classService=retrofit.create(ClassService.class);
        return classService.getClassById(class_id);
    }
    //报名课程
    public Call<Classes> addclassyn(int user_id, int class_id){
        ClassService classService = retrofit.create(ClassService.class);
        return classService.addclassyn(user_id,class_id);
    }

    /*public Call getShopById(){
        ActivityService activityService=retrofit.create(ActivityService.class);
        return  activityService.getAllShops();

    }*/
    /*public Call getFoodByShop(int shop_id){
        FoodService siService = retrofit.create(FoodService.class);
        return siService.getFoodByShop(shop_id);
    }*/
}

